﻿<Window
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:System="clr-namespace:System;assembly=mscorlib"
        xmlns:userTextBox="clr-namespace:AddProductLib.UserTextBox" x:Name="Okno" x:Class="AddProductLib.WPridatZbozi"
        Title="Přidat zboží" Height="493" Width="500" WindowStartupLocation="CenterScreen" Loaded="Okno_Loaded" Closing="Okno_Closing">
    <Window.Resources>

        <Style x:Key="SpecialScrollBar" TargetType="{x:Type ScrollBar}">
            <Setter Property="Stylus.IsFlicksEnabled" Value="false"/>
            <Setter Property="Width" Value="Auto"/>
            <Setter Property="MinHeight" Value="30"/>
            <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type ScrollBar}">
                        <Border BorderThickness="1" BorderBrush="Gray">
                            <Grid Margin="2">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition/>
                                    <ColumnDefinition />
                                </Grid.ColumnDefinitions>
                                <TextBlock VerticalAlignment="Center" FontSize="20" MinWidth="25" Text="{Binding Value, RelativeSource={RelativeSource TemplatedParent}}"/>
                                <Grid Grid.Column="1" x:Name="GridRoot" Width="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" Background="{TemplateBinding Background}">
                                    <Grid.RowDefinitions>
                                        <RowDefinition MaxHeight="18"/>
                                        <RowDefinition Height="0.00001*"/>
                                        <RowDefinition MaxHeight="18"/>
                                    </Grid.RowDefinitions>
                                    <RepeatButton x:Name="DecreaseRepeat" Command="ScrollBar.LineDownCommand" Focusable="False">
                                        <Grid>
                                            <Path x:Name="DecreaseArrow" Stroke="{TemplateBinding Foreground}" StrokeThickness="1" Data="M 0 4 L 8 4 L 4 0 Z"/>
                                        </Grid>
                                    </RepeatButton>
                                    <RepeatButton Grid.Row="2" x:Name="IncreaseRepeat" Command="ScrollBar.LineUpCommand" Focusable="False">
                                        <Grid>
                                            <Path x:Name="IncreaseArrow" Stroke="{TemplateBinding Foreground}" StrokeThickness="1" Data="M 0 0 L 4 4 L 8 0 Z"/>
                                        </Grid>
                                    </RepeatButton>
                                </Grid>
                            </Grid>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <DataTemplate x:Key="MujListBox">
            <StackPanel Margin="3">
                <DockPanel>
                    <TextBlock Text="{Binding Jmeno}"
                               DockPanel.Dock="Left" 
                               Foreground="Green" 
                               FontWeight="Bold"
                               Margin="5,0,10,0"/>
                </DockPanel>
                <DockPanel >
                    <TextBlock Text="{Binding OdKdy}" DockPanel.Dock="Left" Margin="20,0,5,0"/>
                </DockPanel>
                <DockPanel >
                    <TextBlock Text="{Binding DoKdy}" DockPanel.Dock="Left" Margin="20,0,5,0"/>
                </DockPanel>
            </StackPanel>
        </DataTemplate>

    </Window.Resources>
    <Grid Margin="0,0,2,52" Background="#FFF1F1F1">
        <GroupBox Header="Nastavení" HorizontalAlignment="Left" Margin="10,141,0,0" VerticalAlignment="Top" Height="262" Width="470" Foreground="#FF226E91" FontWeight="Bold" FontSize="14" BorderBrush="#FF226E91"/>
        <GroupBox Header="Informace" HorizontalAlignment="Left" Margin="50,0,0,0" VerticalAlignment="Top" Height="141" Width="430" Foreground="#FF226E91" FontWeight="Bold" FontSize="14" BorderBrush="#FF226E91"/>
        <userTextBox:userTextBox x:Name="tb_Nazev" HorizontalAlignment="Left" Height="23" VerticalAlignment="Top" Width="173" Margin="194,58,0,0" LostFocus="tb_Nazev_LostFocus"/>

        <Label Content="Název:" HorizontalAlignment="Left" Margin="144,55,0,0" VerticalAlignment="Top"/>

        <Label Content="Datum půjčení:" HorizontalAlignment="Left" Margin="37,164,0,0" VerticalAlignment="Top" FontSize="14" FontWeight="Bold"/>
        <DatePicker x:Name="date_OdDne" HorizontalAlignment="Left" Margin="37,198,0,0" VerticalAlignment="Top" Width="179" SelectedDate="{x:Static System:DateTime.Now}" FontWeight="Bold" Foreground="#FFFF2300" FirstDayOfWeek="Monday" SelectedDateFormat="Long" TabIndex="3"/>
        <Label Content="Na dobu:" HorizontalAlignment="Left" Margin="68,230,0,0" VerticalAlignment="Top"/>
        <Label Content="Čárový kód:" HorizontalAlignment="Left" Margin="117,27,0,0" VerticalAlignment="Top" RenderTransformOrigin="1.978,-1.192"/>
        <TextBox x:Name="tb_CarovyKod" HorizontalAlignment="Left" Height="23" Margin="194,30,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="173" Background="#FFEEE0E0" FontStyle="Italic" FontWeight="Bold" LostFocus="tb_CarovyKod_LostFocus" TabIndex="2000" PreviewTextInput="tb_CarovyKod_PreviewTextInput" GotFocus="tb_CarovyKod_GotFocus" Text="neznámý"/>

        <TextBox x:Name="tb_PocetDni" HorizontalAlignment="Left" Height="23" Margin="132,233,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="54" RenderTransformOrigin="0.542,0.174" PreviewTextInput="tb_PocetDni_PreviewTextInput" TextChanged="tb_PocetDni_TextChanged" FontSize="14" TabIndex="4" LostFocus="tb_PocetDni_LostFocus"/>
        <Label Content="dní" HorizontalAlignment="Left" Margin="191,230,0,0" VerticalAlignment="Top" Width="36"/>
        <Label Content="Rezerva:" HorizontalAlignment="Left" Margin="73,261,0,0" VerticalAlignment="Top" RenderTransformOrigin="0.759,0.385"/>
        <Label Content="dní" HorizontalAlignment="Left" Margin="191,261,0,0" VerticalAlignment="Top" Width="36"/>
        <Calendar x:Name="MujKalendar" HorizontalAlignment="Left" Margin="289,227,0,0" VerticalAlignment="Top" SelectedDatesChanged="Calendar_SelectedDatesChanged_1" SelectionMode="MultipleRange" TabIndex="6"/>
        <Label Content="Datum vrácení:" HorizontalAlignment="Left" Margin="289,164,0,0" VerticalAlignment="Top" RenderTransformOrigin="0.759,0.385" FontSize="14" FontWeight="Bold"/>

        <ScrollBar x:Name="sb_Rezerva" HorizontalAlignment="Left" Height="25" Width="54" Style="{DynamicResource SpecialScrollBar}" VerticalAlignment="Top" Margin="132,261,0,0" FontSize="10" FontWeight="Normal" RenderTransformOrigin="-0.219,0.367" Maximum="100" SmallChange="1" ValueChanged="sb_Rezerva_ValueChanged" TabIndex="5"/>
        <Label x:Name="lb_DatumVraceni" Content="datum" HorizontalAlignment="Left" Margin="289,196,0,0" VerticalAlignment="Top" RenderTransformOrigin="0.759,0.385" FontWeight="Bold" Foreground="#FFFF2300"/>
        <Image HorizontalAlignment="Left" Height="39" Margin="10,14,0,0" VerticalAlignment="Top" Width="63" Source="Obrazky/ski.png" Grid.Column="0"/>
        <Label Content="Cenový profil:" HorizontalAlignment="Left" Margin="106,86,0,0" VerticalAlignment="Top"/>
        <Label x:Name="lb_CenovyProfil" Content="neznámý" HorizontalAlignment="Left" Margin="189,86,0,0" VerticalAlignment="Top" FontWeight="Bold" Foreground="Black"/>

        <Label x:Name="label1" Content="Cena za půjčení:" HorizontalAlignment="Left" Margin="10,412,0,-50" VerticalAlignment="Top" RenderTransformOrigin="0.427,-3.846" FontSize="16" Foreground="#FFF57911" FontWeight="Bold"/>
        <Button x:Name="bt_Storno" Content="Storno" HorizontalAlignment="Left" Height="27" Margin="393,415,0,-50" VerticalAlignment="Top" Width="75" Click="bt_Storno_Click" TabIndex="8"/>
        <Button x:Name="bt_Pridat" Content="Potvrdit" HorizontalAlignment="Left" Height="27" Margin="289,415,0,-50" VerticalAlignment="Top" Width="90" FontWeight="Bold" FontSize="14" RenderTransformOrigin="0.289,0.407" Click="bt_Pridat_Click" TabIndex="7"/>
        <TextBox x:Name="tb_CelkovaCena" HorizontalAlignment="Left" Height="27" Margin="146,416,0,-50" TextWrapping="Wrap" Text="0" VerticalAlignment="Top" Width="98" FontSize="16" FontWeight="Bold" TextChanged="tb_CelkovaCena_TextChanged" PreviewTextInput="tb_CelkovaCena_PreviewTextInput"/>
        <Label x:Name="label1_Copy" Content="Kč" HorizontalAlignment="Left" Margin="244,416,0,-50" VerticalAlignment="Top" RenderTransformOrigin="0.427,-3.846" FontSize="16" Foreground="#FFF57911" FontWeight="Bold"/>
        <Label x:Name="lb_Stav" Content="Stav:" HorizontalAlignment="Left" Margin="154,110,0,0" VerticalAlignment="Top" RenderTransformOrigin="0.971,0.385"/>
        <Label x:Name="lb_StatusZbozi" Content="neznámý" HorizontalAlignment="Left" Margin="189,110,0,0" VerticalAlignment="Top" FontWeight="Bold"/>
        <Expander x:Name="MujExpander" Header="Přehled termínů" HorizontalAlignment="Left" Margin="280,111,0,0" VerticalAlignment="Top" Width="200" Height="168">
            <Grid Background="Cornsilk">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="10*"/>
                    <ColumnDefinition Width="51*"/>
                    <ColumnDefinition Width="137*"/>
                </Grid.ColumnDefinitions>
                <ListBox x:Name="list_Prehled" HorizontalAlignment="Left" Height="142" Margin="0,3,0,0" VerticalAlignment="Top" Width="198"
        			ItemTemplate="{StaticResource MujListBox}" Grid.ColumnSpan="3"/>
            </Grid>
        </Expander>
    </Grid>
</Window>
